package day_2022_7_to_8.day48;

/**
 * @author haomin
 * @date 2022/08/15 21:47
 **/
public class Day30_3_Num48_Rotate {
    class Solution {
        public void rotate(int[][] matrix) {
            int n = matrix.length;
            for(int i = 0;i < n/2;++i){
                for(int j = 0;j < (n+1)/2;++j){
                    int temp = matrix[i][j];
                    matrix[i][j] = matrix[n-j-1][i];
                    matrix[n-j-1][i] = matrix[n-i-1][n-j-1];
                    matrix[n-i-1][n-j-1] = matrix[j][n-i-1];
                    matrix[j][n-i-1] = temp;
                }
            }
            return;
        }
    }
}